#include <iostream>
#include<functional>
using namespace std;
typedef  std::function<void(int,const uint16_t,const string&,const string& )>fun_t;

class task
{
public:
    task()
    {
    } 
    
    task(int socket,uint16_t port,string& ip,fun_t fun)
    :_socket(socket)
    ,_port(port)
    ,_ip(ip)
    ,_fun(fun)
    {
         
    }
   void operator()(const string&name)
    {
         _fun(_socket,_port,_ip,name);
    }

private:
    int _socket;
    uint16_t _port;
    std::string _ip;
    fun_t _fun;
};